import math

def triangle():
	current = 1
	num = 2
	while True:
		yield current
		current = current + num
		num = num + 1

def getnfact(n):
	num = 0
	for x in range(1,int(math.sqrt(n))+1):
		if(n % x == 0):
			num = num + 1
	return num*2

for x in triangle():
	if getnfact(x) > 500:
		print(x)
		break